<?php
session_start();
require('../conn.php');
require('../functions.php');
require('admin.php');
$page = $_GET['page'];
if (is_numeric($page) == false) {
    $page = 1;
    $page_1 = 1;
    $min = 0;
    $page_2 = $page + 1;
} else {
    if ($page > 1) {
        $page_2 = $page + 1;
        $min = ($page - 1) * 35;
        $page_1 = $page - 1;
    } else {
        $page_1 = 1;
        $min = 0;
        $page_2 = 2;
    }
}
$max = $page * 35;
$sql="select * from `sharedata` ORDER by day DESC,time DESC limit $min,$max";
$row_user = $mysql->query($sql);
?>

<?php include('head.php') ?>
<div class="container-fluid">
    <div class="row-fluid">
        <?php
        include('left.php'); ?>
        <div class="span10">
            <h1 class="page-title">用户分享积分明细</h1>
            <div class="well">
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <div class="well">
                            <form class="navbar-search pull-left" action="user_score_detail.php" method="get">
                                <input type="hidden" name="do" value="search">
                                <input type="text" class="search-query" placeholder="#+id搜索会员" name="phone">
                            </form>
                            <div class="pull-right">
                                <a href="user_share_score.php" class="btn">首页</a></button>
                                <a href="user_share_score.php?page=<?php echo $page_1 ?>" class="btn"
                                   style="margin-left:5px;">上一页</a>
                                <a href="user_share_score.php?page=<?php echo $page_2 ?>" class="btn"
                                   style="margin-left:5px;">下一页</a>
                            </div>
                            <table class="table">
                                <thead>
                                <tr>
                                    <th>用户id</th>
                                    <th>用户名</th>
                                    <th>积分</th>
                                    <th>文章id</th>
                                    <th>ip</th>
                                    <th>设备</th>
                                    <th>域名</th>
                                    <th>日期</th>
                                    <th>时间</th>
                                    <th>类型</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php  $i=1; foreach($row_user as $key=>$val){
                                  ?>
                                	 <tr>
                                         <?php
                                         $username = $mysql->query("select name from user where id={$val['uid']}");
                                         if($val['type'] == 1){
                                             $val['money'] = 0;
                                         }
                                         ?>
                                          <td><?=$val['uid']?></td>
								          <td><?=$username[0]['name']?></td>
								     	  <td><?=$val['money']?></td>
								     	  <td><?=$val['aid']?></td>
								     	  <td><?=$val['ip']?></td>
										  <td><?=$val['device']?></td>
										  <td><?=$val['domain']?></td>
										  <td><?=$val['day']?></td>
                                          <td><?=$val['time']?></td>
										  <td><?=$val['type']?></td>
									</tr>
                             <?php }?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="profile">
                    </div>
                </div>

            </div>

        </div>
    </div>


</div>

<footer>
    <hr>

    <p class="pull-right"><!--power by right--></p>


    <p><!--power by --></p>
</footer>



<script src="lib/bootstrap/js/bootstrap.js"></script>


</body>
</html>